#!/usr/bin/python3
# coding=utf-8
from pytdx.hq import TdxHq_API
from pytdx.params import TDXParams

api = TdxHq_API()

if api.connect('119.147.212.81', 7709):
    data = api.get_history_minute_time_data(TDXParams.MARKET_SZ, '002727', 20230912) #返回一心堂历史分时行情
    data = api.to_df(data) # 返回DataFrame
    print(data)
    api.disconnect()